package flc.ast.adapter;

import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;

import flc.ast.R;
import flc.ast.bean.OrientationBean;
import flc.ast.databinding.ItemRvOrientationStyleBinding;
import stark.common.basic.adapter.BaseDBRVAdapter;

public class OrientationAdapter extends BaseDBRVAdapter<OrientationBean, ItemRvOrientationStyleBinding> {

    public OrientationAdapter() {
        super(R.layout.item_rv_orientation_style, 0);
    }

    @Override
    protected void convert(@NonNull BaseDataBindingHolder<ItemRvOrientationStyleBinding> holder, OrientationBean item) {
        super.convert(holder, item);
        ItemRvOrientationStyleBinding binding = holder.getDataBinding();
        if (item.isSelected()) {
            binding.ivIcon.setImageResource(item.getSelImg());
        } else {
            binding.ivIcon.setImageResource(item.getImm());
        }
    }
}
